from fastapi import Request


async def restricted_ip(request: Request):
    # 允许访问的IP地址列表
    allowed_ips = [
        "127.0.0.1",
        "175.178.194.85",
        "10.136.6.211"
    ]
    ip = request.client.host
    if ip not in allowed_ips:
        print(ip)
        return False
    return True
